<extend name="_Layout/main"/>

<block name="style">
    <style type="text/css">
        .is_read,
        .is_read a {
            color: #ccc;
        }
    </style>
</block>

<block name="breadcrumb">
    <div class="container">
        <ul class="breadcrumb">
            <li><i class="icon-location-arrow"></i></li>
            <li><a href="__ROOT__/">首页</a></li>
            <li><a href="{:U('')}">消息中心</a></li>
        </ul>
    </div>
</block>

<block name="main">
    <div class="container builder builder-list-box">
        <div class="row">
            <div class="col-xs-12 col-md-3">
                <include file="User/side" /><!-- 包含用户中心侧边导航 -->
            </div>
            <div class="col-xs-12 col-md-9">
                <div class="box">
                    <ul class="nav-tabs nav">
                        <volist name="message_type" id="type">
                            <li class="<php>if($__CURRENT_MESSAGE_TYPE == $key) echo 'active';</php>">
                                <a class="<php>if($new_message_type[$key]){echo 'red-dot';}</php>" href="{:U('UserMessage/index', array('type' => $key))}">{$type}</a>
                            </li>
                        </volist>
                    </ul>
                    <div class="builder-toolbar builder-list-toolbar">
                        <a class="btn btn-info ajax-post" target-form="ids" href="{:U('readAll', array('type' => $__CURRENT_MESSAGE_TYPE))}">设为已读</a>
                    </div>
                    <div class="tab-content">
                        <div class="builder-table">
                            <div class="panel panel-default">
                                <table class="table table-bordered table-responsive table-striped table-hover">
                                    <thead>
                                        <tr>
                                            <th><input class="check-all" type="checkbox"></th>
                                            <th>消息</th>
                                            <th>时间</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <volist name="message_list" id="vo">
                                            <tr>
                                                <td><input class="ids" type="checkbox" value="{$vo.id}" name="ids[]"></td>
                                                <td><span class="<php>if($vo['is_read']){echo 'is_read';}</php>">{$vo.title}</span></td>
                                                <td>{$vo.ctime|time_format}</td>
                                            </tr>
                                        </volist>
                                        <empty name="message_list">
                                            <tr class="builder-data-empty">
                                                <td class="text-center empty-info" colspan="3">
                                                    <i class="fa fa-database"></i> 暂时没有消息<br>
                                                </td>
                                            </tr>
                                        </empty>
                                    </tbody>
                                </table>
                            </div>
                            <notempty name="page">
                                <ul class="pagination">{$page}</ul>
                            </notempty>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
